#include <Windows.h>
#include "hud.h"
#include <gl/GLU.h>

//---------------------------------------- PutCanvas ---------------------------------------------//
void Hud::PutCanvas(const int width, const int height)
{
    glPushMatrix();                     // save current modelview matrix
    glLoadIdentity();                   // reset modelview matrix

    // set to 2D orthogonal projection
    glMatrixMode(GL_PROJECTION);        // switch to projection matrix
    glPushMatrix();                     // save current projection matrix
    glLoadIdentity();                   // reset projection matrix
    gluOrtho2D(0, width, 0, height);    // set to orthogonal projection
}
//---------------------------------------- TakeCanvas --------------------------------------------//
void Hud::TakeCanvas()
{
    // restore projection matrix
    glPopMatrix();                      // restore to previous projection matrix

    // restore modelview matrix
    glMatrixMode(GL_MODELVIEW);         // switch to modelview matrix
    glPopMatrix();                      // restore to previous modelview matrix
}